package com.lzm.ydpt.entity;

public class GoodsBean {
    private long goods_id;
    private String goods_name;
    private int goods_count = 1;
    private boolean isSelect;

    public GoodsBean(long goods_id, String goods_name, boolean isSelect) {
        this.goods_id = goods_id;
        this.goods_name = goods_name;
        this.isSelect = isSelect;
    }

    /**
     * 重写hashCode，方便集合的操作
     */
    @Override
    public int hashCode() {
        return (int) (this.goods_id + this.goods_id);
    }

    /**
     * 重写equals，只要tagid相同就默认是通对象，才认为这个对象是想等的
     */
    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof GoodsBean)) {
            return false;
        }
        GoodsBean tempBean = (GoodsBean) obj;
        return (this.goods_id == tempBean.goods_id);
    }

    public long getGoods_id() {
        return goods_id;
    }

    public void setGoods_id(long goods_id) {
        this.goods_id = goods_id;
    }

    public int getGoods_count() {
        return goods_count;
    }

    public void setGoods_count(int goods_count) {
        this.goods_count = goods_count;
    }

    public String getGoods_name() {
        return goods_name;
    }

    public void setGoods_name(String goods_name) {
        this.goods_name = goods_name;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }
}